/* 
 * File:   ShortMsgItem.hpp
 * Author: bd
 *
 * Created on March 28, 2011, 8:59 PM
 */

#ifndef SHORTMSGITEM_HPP
#define	SHORTMSGITEM_HPP
#include <boost/date_time/posix_time/posix_time.hpp>
#include <ostream>

struct ShortMsgItem {

    enum Status {
        INITIAL = 0, INPROGRESS, SUCCESS, FAIL
    };
    ShortMsgItem();

    int id;
    int groupId;
    int xid;
    std::string toAddr, fromAddr;
    boost::posix_time::ptime insertDate;
    Status status;
    std::string handler;
    boost::posix_time::ptime lastUpdate;
    int retry;
    friend std::ostream & operator<<(std::ostream& os, const ShortMsgItem & smi);
    friend std::ostream & serialize(std::ostream& os, const ShortMsgItem&);
    friend std::ostream & serializeXml(std::ostream& os, const ShortMsgItem&);
};


#endif	/* SHORTMSGITEM_HPP */

